<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Form example</title>
    <link href="/kh/css/bootstrap.css" rel="stylesheet">
</head>
<body>
<form action="/kh/upload/save" method="post" enctype="multipart/form-data" class="well">
    <?php
    if (isset($msgs)) {
        if (is_array($msgs)) {
            if (array_key_exists('ok', $msgs)) {
                echo 'Messages:';
            } else {
                echo '<p>Errors:</p>';
            }
            $data = '<ul class="error">';
            foreach ($msgs as $field => $error) {
                $data .= '<li>' . HTML::chars($error) . '</li>';
            }
            $data .= '</ul><br/>';

            echo $data;
        } else {
            echo '<div class="error">' . HTML::chars($msgs) . '</div>';
        }
    }
    ?>
    <label>File name</label>
    <input name="file" type="file" class="span3" placeholder="">
    <label>Description</label>
    <input name="description" type="text" class="span3" placeholder="small text here…" maxlength="50"><br/>
    <button type="submit" class="btn">Submit</button>
</form>
<br/>
<p style="padding-left: 20px;"><a href="/kh/">Image List>></a></p>
</body>
</html>

